package alvarodelrosal.chat.client.chataction.remote;

import alvarodelrosal.chat.client.modelo.Connection;
import java.util.ArrayList;
import java.util.List;

public class ChatLogin implements ChatRemoteAction {

    @Override
    public String getName() {
        return "Login";
    }

    @Override
    public void doAction(List<String> parameters) {
        String query = "Login<:@:>" + parameters.get(0) + "<:@:>" + parameters.get(1);
        Connection.sendToServer(query);
    }

    public List<String> convertToParameters(String username, String password) {
        List<String> parameters = new ArrayList();
        parameters.add(username);
        parameters.add(password);
        return parameters;
    }

}
